[FSSDK-12148] Event retry adjustment#398
Merged
junaed-optimizely merged 6 commits intomasterfrom Jan 21, 2026
Merged
Conversation
muzahidul-opti
requested changes
Jan 20, 2026
muzahidul-opti
left a comment
There was a problem hiding this comment.
Looks good, made a couple of comments
There was a problem hiding this comment.
Pull request overview
This pull request introduces a standardized retry and exponential backoff mechanism for event dispatching across the Optimizely C# SDK. The changes implement automatic retries (up to 3 total attempts) with exponential backoff (starting at 200ms, doubling to max 1000ms) for failed event dispatches on 5xx server errors and network failures.
Changes:
- Created
EventRetryConfigclass with centralized retry constants (max 2 retries, 200ms initial backoff, 1000ms max backoff, 2.0x multiplier) - Refactored
WebRequestEventDispatcher35andHttpClientEventDispatcher45to implement retry logic with exponential backoff - Updated
OdpEventManagerto use the newEventRetryConfigconstants and enhanced error logging - Removed
MAX_RETRIESconstant from ODPConstantsclass in favor of centralized configuration - Added comprehensive unit tests for
HttpClientEventDispatcher45covering success, retry, and backoff scenarios
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| OptimizelySDK/Event/EventRetryConfig.cs | New configuration class defining retry constants (max retries, backoff timing) |
| OptimizelySDK/Event/Dispatcher/HttpClientEventDispatcher45.cs | Refactored dispatcher with retry logic and exponential backoff for .NET 4.5+ |
| OptimizelySDK/Event/Dispatcher/WebRequestEventDispatcher35.cs | Refactored dispatcher with retry logic for .NET 3.5/4.0 |
| OptimizelySDK/Odp/OdpEventManager.cs | Updated to use EventRetryConfig constants and improved error logging |
| OptimizelySDK/Odp/Constants.cs | Removed MAX_RETRIES constant (moved to EventRetryConfig) |
| OptimizelySDK.Tests/EventTests/HttpClientEventDispatcher45Test.cs | New comprehensive test suite for retry behavior and backoff timing |
| OptimizelySDK.Tests/OdpTests/OdpEventManagerTests.cs | Updated test timeout to accommodate backoff delays |
| Various .csproj files | Added EventRetryConfig.cs to project configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mikechu-optimizely
approved these changes
Jan 20, 2026
Contributor
mikechu-optimizely
left a comment
There was a problem hiding this comment.
Implementation looks good. Small suggestion below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces a standardized retry and exponential backoff mechanism for event dispatching across the Optimizely SDKs. The changes ensure that failed event dispatches are retried up to three times with increasing delays, improving reliability in the face of transient network or server errors.
Test plan
Existing tests should pass
Issues